import 'dart:math';

import 'package:flutter_riverpod_test/util/string_util.dart';

class Product {
  Product({required this.id, required this.name, required this.totalCount,});
  String id;
  String name;
  int totalCount;
  int saleCount = 0;

  /// 随机生成Product对象
  static Product randomProduct() {
    String id = StringUtil.randomString(length: 12);
    String name = StringUtil.randomString(length: 6);
    int totalCount = Random().nextInt(10)+1;
    return Product(id: id, name: name, totalCount: totalCount);
  }
}